package ym.ecrm.core.domain.financeManagement;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import ym.ecrm.core.domain.base.BaseEntity;
import ym.ecrm.core.domain.systemManagement.User;

/**
 * 付款凭据类
 * @author fage
 *@version 1.0
 */

@Entity
@Table(name = "t_paymentVoucher")
public class PaymentVoucher extends BaseEntity{
	/**
	 * voucherCode 凭证编号
	 */
	private String voucherCode;
	/**
	 * payments 对应付款记录
	 */
		@OneToMany(targetEntity=Payment.class
				,cascade = {CascadeType.PERSIST,CascadeType.MERGE})
		@JoinColumn(name ="manageCollectionId")
	private Set<Payment> payments = new HashSet<Payment>();
		
	/**
	 * paymentNumber 凭证号码
	 */
	private String paymentNumber;
	/**
	 * sum 金额
	 */
	private String sum;
	/**
	 * paymentTime 凭证日期
	 */
	private String paymentTime;
	/**
	 * payType 付款方式
	 */
	private String payType;
	/**
	 * user  经手人
	 */
	@ManyToOne(targetEntity = User.class
			, cascade = {CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(name = "userId")
	private User user;
	public String getVoucherCode() {
		return voucherCode;
	}
	public void setVoucherCode(String voucherCode) {
		this.voucherCode = voucherCode;
	}
	public Set<Payment> getPayments() {
		return payments;
	}
	public void setPayments(Set<Payment> payments) {
		this.payments = payments;
	}
	public String getPaymentNumber() {
		return paymentNumber;
	}
	public void setPaymentNumber(String paymentNumber) {
		this.paymentNumber = paymentNumber;
	}
	public String getSum() {
		return sum;
	}
	public void setSum(String sum) {
		this.sum = sum;
	}
	public String getPaymentTime() {
		return paymentTime;
	}
	public void setPaymentTime(String paymentTime) {
		this.paymentTime = paymentTime;
	}
	public String getPayType() {
		return payType;
	}
	public void setPayType(String payType) {
		this.payType = payType;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	

}
